package com.apigen.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 模板实体类
 *
 * @author API Generator Platform
 * @since 2025-09-24
 */
@Data
@TableName("gen_template")
@Schema(description = "模板信息")
public class GenTemplate {

    /**
     * 模板ID
     */
    @TableId(value = "template_id", type = IdType.AUTO)
    @Schema(description = "模板ID", example = "1")
    private Long templateId;

    /**
     * 模板名称
     */
    @TableField("template_name")
    @Schema(description = "模板名称", example = "Spring Boot Admin Template")
    private String templateName;

    /**
     * 模板编码
     */
    @TableField("template_code")
    @Schema(description = "模板编码", example = "spring-boot-admin")
    private String templateCode;

    /**
     * 模板描述
     */
    @TableField("description")
    @Schema(description = "模板描述", example = "基于Spring Boot的后台管理系统模板")
    private String description;

    /**
     * 模板类型
     */
    @TableField("template_type")
    @Schema(description = "模板类型", example = "BACKEND")
    private String templateType;

    /**
     * 技术栈
     */
    @TableField("tech_stack")
    @Schema(description = "技术栈", example = "Spring Boot + MyBatis Plus + Vue 3")
    private String techStack;

    /**
     * 适用场景
     */
    @TableField("use_case")
    @Schema(description = "适用场景", example = "后台管理系统、企业级应用")
    private String useCase;

    /**
     * 模板版本
     */
    @TableField("version")
    @Schema(description = "模板版本", example = "1.0.0")
    private String version;

    /**
     * 作者
     */
    @TableField("author")
    @Schema(description = "作者", example = "API Generator Team")
    private String author;

    /**
     * 许可证
     */
    @TableField("license")
    @Schema(description = "许可证", example = "MIT")
    private String license;

    /**
     * 官网地址
     */
    @TableField("homepage")
    @Schema(description = "官网地址", example = "https://example.com")
    private String homepage;

    /**
     * Git仓库地址
     */
    @TableField("repository_url")
    @Schema(description = "Git仓库地址", example = "https://gitee.com/example/template")
    private String repositoryUrl;

    /**
     * 演示地址
     */
    @TableField("demo_url")
    @Schema(description = "演示地址", example = "https://demo.example.com")
    private String demoUrl;

    /**
     * 文档地址
     */
    @TableField("document_url")
    @Schema(description = "文档地址", example = "https://docs.example.com")
    private String documentUrl;

    /**
     * 封面图片
     */
    @TableField("cover_image")
    @Schema(description = "封面图片", example = "/images/template-cover.jpg")
    private String coverImage;

    /**
     * 截图列表
     */
    @TableField("screenshots")
    @Schema(description = "截图列表（JSON格式）")
    private String screenshots;

    /**
     * 标签
     */
    @TableField("tags")
    @Schema(description = "标签", example = "管理系统,Vue3,Element Plus")
    private String tags;

    /**
     * 是否启用
     */
    @TableField("is_enabled")
    @Schema(description = "是否启用", example = "true")
    private Boolean isEnabled;

    /**
     * 是否推荐
     */
    @TableField("is_recommended")
    @Schema(description = "是否推荐", example = "false")
    private Boolean isRecommended;

    /**
     * 排序
     */
    @TableField("sort_order")
    @Schema(description = "排序", example = "100")
    private Integer sortOrder;

    /**
     * 下载次数
     */
    @TableField("download_count")
    @Schema(description = "下载次数", example = "1250")
    private Integer downloadCount;

    /**
     * 评分
     */
    @TableField("rating")
    @Schema(description = "评分", example = "4.8")
    private Double rating;

    /**
     * 模板配置（JSON格式）
     */
    @TableField("template_config")
    @Schema(description = "模板配置（JSON格式）")
    private String templateConfig;

    /**
     * 依赖配置（JSON格式）
     */
    @TableField("dependencies")
    @Schema(description = "依赖配置（JSON格式）")
    private String dependencies;

    /**
     * 特性列表（JSON格式）
     */
    @TableField("features")
    @Schema(description = "特性列表（JSON格式）")
    private String features;

    /**
     * 创建者ID
     */
    @TableField("creator_id")
    @Schema(description = "创建者ID", example = "1000")
    private Long creatorId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 最后下载时间
     */
    @TableField("last_download_time")
    @Schema(description = "最后下载时间")
    private LocalDateTime lastDownloadTime;

    /**
     * 是否删除
     */
    @TableField("deleted")
    @TableLogic
    @Schema(description = "是否删除", example = "false")
    private Boolean deleted;
}










